package com.raincat.tools.multimediapickertools.utils;

import java.util.List;

/**
 * <pre>
 *     author : RainCat
 *     org    : Shenzhen JingYu Network Technology Co., Ltd.
 *     e-mail : nining377@gmail.com
 *     time   : 2020/05/13
 *     desc   : 权限获取监听
 *     version: 1.0
 * </pre>
 */
class PickerListenerManager {
    private PickerListener pickerListener;
    private static PickerListenerManager manager;

    public static PickerListenerManager getInstance() {
        if (manager == null)
            manager = new PickerListenerManager();
        return manager;
    }

    void setPickerListenerListener(PickerListener pickerListener) {
        this.pickerListener = pickerListener;
    }

    void onPicker(List<MultiMediaItem> list) {
        if (pickerListener != null) {
            pickerListener.onPicked(list);
        }
    }

    void onDestroy() {
        pickerListener = null;
        manager = null;
    }
}
